package com.bidevalution.support.util;

import org.apache.log4j.Logger;
import org.apache.log4j.PropertyConfigurator;

public class LogUtil {

	private static LogUtil logUtil;

    private Logger logger;



    public LogUtil(Class<?> clazz,String configPath) {

        PropertyConfigurator.configure(configPath);

        // this.logger = Logger.getRootLogger();

        this.logger = Logger.getLogger(clazz);

    }



    public static LogUtil getLogManager(Class<?> clazz) {

        if (logUtil == null) {

        	logUtil = new LogUtil(clazz,"log4j.properties");

        }

        return logUtil;

    }



    public void debug(Object str) {

    	logUtil.logger.debug(str);

    }



    public void info(Object str) {

    	logUtil.logger.info(str);

    }



    public void warn(Object str) {

    	logUtil.logger.warn(str);

    }



    public void error(Object str) {

    	logUtil.logger.error(str);

    }
    public void error(Object str,Throwable throwable) {

    	logUtil.logger.error(str);

    }



    public void fatal(Object str) {

    	logUtil.logger.fatal(str);

    }
}
